#include<iostream>
#include<pthread.h>
#include<unistd.h>
#include<cstring>
#include<string>


using namespace std;
class Request{
public:
    Request(int start,int end,const string& threadname)
        :_start(start)
        ,_end(end)
        ,_threadname(threadname)
        {}
public:
    int _start;
    int _end; 
    string _threadname;

};

class Response
{
public:
    Response(int ret,int exitcode)
        :_ret(ret)
        ,_exitcode(exitcode)
    {}
public:
    int _ret;
    int _exitcode;
};

void* sumCount(void* args)
{
    Request* rq = static_cast<Request*>(args);
    Response* rsp = new Response(0,0);
    for(int i = rq->_start;i<=rq->_start;i++)
    {
        rsp->_ret+=i;
        usleep(10000);
    }
    delete rq;
    return rsp;
}
int main()
{
    pthread_t tid;
    Request* rq = new Request(0,100,"thread1");
    pthread_create(&tid,nullptr,sumCount,rq);

    void* ret;
    pthread_join(tid,&ret);
    Response* rsp = static_cast<Response*>(ret);
    delete rsp;


    return 0;
}
